//
//  FoodCollectionViewCell.m
//  MeiShiDa
//
//  Created by duanshiyi on 15/7/2.
//  Copyright (c) 2015年 zby. All rights reserved.
//

#import "FoodCollectionViewCell.h"
#import <UIImageView+WebCache.h>
@implementation FoodCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithFrame:(CGRect)frame{
    self=[super initWithFrame:frame];
    if (self) {
//        NSLog(@"%@frame", NSStringFromCGRect(frame));
        self.image=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [self.contentView addSubview:_image];
        self.label=[[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height*4/5, frame.size.width, frame.size.height/5)];
        _label.textAlignment=NSTextAlignmentCenter;
        _label.textColor=[UIColor whiteColor];
        _label.backgroundColor=[UIColor blackColor];
        _label.alpha=0.5;
        [self addSubview:_label];
    }
    return self;
}

-(void)setModel:(FoodModel *)model{
    if (_model!=model) {
        _model=model;
    }
    [self.image sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.tudali.com:7177%@",model.IndexImage]]placeholderImage:[UIImage imageNamed:@"13d2172cd62259f8b012eba964a4a307.jpg"]];
    self.image.backgroundColor = [UIColor redColor];
    self.label.text=model.MingCheng;
}




@end
